package com.neusoft.neuiotms.dcom.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotBlank;

import org.hibernate.validator.constraints.Length;

import com.neusoft.bizcore.web.jpa.model.AbstractModel;
import com.neusoft.bizcore.web.jpa.model.Comment;

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
@Entity
@Table(name = "neuiot_knowledge_attachment")
@org.hibernate.annotations.Table(appliesTo = "neuiot_knowledge_attachment", comment = "知识库附件")
public class KnowledgeAttachment extends AbstractModel {

    private static final long serialVersionUID = 1187423970163950831L;

    @NotBlank(message = "附件名称")
    @Length(max = 1023, message = "附件名称不能超过{max}位")
    @Column(length = 1023, nullable = false)
    @Comment("varchar(1023) NOT NULL COMMENT '附件名称'")
    private String name;

    @NotBlank(message = "附件fsId")
    @Length(max = 1023, message = "附件fsId不能超过{max}位")
    @Column(length = 1023, nullable = false)
    @Comment("varchar(1023) NOT NULL COMMENT '附件fsId'")
    private String fsId;

    @ManyToOne
    private Knowledge knowledge;
}
